package com.zh.common.base;

import com.zh.common.domain.UserDO;
import com.zh.common.vo.CompanyUserVO;
import com.zh.common.vo.FamilyUserVO;
import com.zh.common.utils.ShiroUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;

@Controller
public class BaseController {
	public static Logger logger= LoggerFactory.getLogger(BaseController.class);

	public UserDO getUser() {
		return ShiroUtils.getUser();
	}

	public String getUserId() {
		return getUser().getUserId();
	}

	public String getUsername() {
		return getUser().getUsername();
	}

	//自行扩展字段，请看CompanyUserVO
	public CompanyUserVO getCompanyUser() {
		return ShiroUtils.getCompanyUser();
	}

	//获取家庭用户，自行扩展字段，FamilyUserVO
	public  FamilyUserVO getFamilyUser() {
		return ShiroUtils.getFamilyUser();
	}
}